package com.cskaoyan.vo.market;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @program: mall
 * @description:
 * @author: Mr.Mengmeng
 * @create: 2021-04-10 14:40
 **/
@Data
public class OrderDetailDataVo {

    /**
     * orderGoods : [{"id":31,"orderId":31,"goodsId":1116011,"goodsName":"蔓越莓曲奇 200克","goodsSn":"1116011","productId":167,"number":1,"price":36,"specifications":["标准"],"picUrl":"http://yanxuan.nosdn.127.net/767b370d07f3973500db54900bcbd2a7.png","comment":0,"addTime":"2021-03-26 13:45:43","updateTime":"2021-03-26 13:45:43","deleted":false}]
     * user : {"nickname":"测试用户","avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80"}
     * order : {"id":31,"userId":1,"orderSn":"20210326640201","orderStatus":102,"consignee":"张松","mobile":"18566549962","address":"安徽省 合肥市 瑶海区 碧桂园","message":"111","goodsPrice":36,"freightPrice":8,"couponPrice":0,"integralPrice":0,"grouponPrice":0,"orderPrice":44,"actualPrice":44,"comments":0,"endTime":"2021-03-26 13:45:57","addTime":"2021-03-26 13:45:43","updateTime":"2021-03-26 13:45:57","deleted":false}
     */

    private UserBean user;
    private OrderBean order;
    private List<OrderGoodsBean> orderGoods;

    public OrderDetailDataVo(UserBean user, OrderBean order, List<OrderGoodsBean> orderGoods) {
        this.user = user;
        this.order = order;
        this.orderGoods = orderGoods;
    }

    public OrderDetailDataVo() {
    }


    @Data
    public static class UserBean {
        /**
         * nickname : 测试用户
         * avatar : https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80
         */

        private String nickname;
        private String avatar;

        public UserBean(String nickname, String avatar) {
            this.nickname = nickname;
            this.avatar = avatar;
        }

        public UserBean() {
        }

    }
    @Data
    public static class OrderBean {
        /**
         * id : 31
         * userId : 1
         * orderSn : 20210326640201
         * orderStatus : 102
         * consignee : 张松
         * mobile : 18566549962
         * address : 安徽省 合肥市 瑶海区 碧桂园
         * message : 111
         * goodsPrice : 36.0
         * freightPrice : 8.0
         * couponPrice : 0.0
         * integralPrice : 0.0
         * grouponPrice : 0.0
         * orderPrice : 44.0
         * actualPrice : 44.0
         * comments : 0
         * endTime : 2021-03-26 13:45:57
         * addTime : 2021-03-26 13:45:43
         * updateTime : 2021-03-26 13:45:57
         * deleted : false
         */

        private Integer id;
        private Integer userId;
        private String orderSn;
        private Short orderStatus;
        private String consignee;
        private String mobile;
        private String address;
        private String message;
        private BigDecimal goodsPrice;
        private BigDecimal freightPrice;
        private BigDecimal couponPrice;
        private BigDecimal integralPrice;
        private BigDecimal grouponPrice;
        private BigDecimal orderPrice;
        private BigDecimal actualPrice;
        private Short comments;
        @DateTimeFormat
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
        private Date endTime;
        @DateTimeFormat
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
        private Date addTime;
        @DateTimeFormat
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
        private Date updateTime;
        private boolean deleted;


    }
    @Data
    public static class OrderGoodsBean {
        /**
         * id : 31
         * orderId : 31
         * goodsId : 1116011
         * goodsName : 蔓越莓曲奇 200克
         * goodsSn : 1116011
         * productId : 167
         * number : 1
         * price : 36.0
         * specifications : ["标准"]
         * picUrl : http://yanxuan.nosdn.127.net/767b370d07f3973500db54900bcbd2a7.png
         * comment : 0
         * addTime : 2021-03-26 13:45:43
         * updateTime : 2021-03-26 13:45:43
         * deleted : false
         */

        private Integer id;
        private Integer orderId;
        private Integer goodsId;
        private String goodsName;
        private String goodsSn;
        private Integer productId;
        private Short number;
        private BigDecimal price;
        private String picUrl;
        private Integer comment;
        @DateTimeFormat
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
        private Date addTime;
        @DateTimeFormat
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
        private Date updateTime;
        private boolean deleted;
        private String[] specifications;


    }
}
